﻿using BJoin.Application.BObject;
using System.ComponentModel.DataAnnotations.Schema;

namespace BJoin.Application.Dto
{
    public class ReqFilterDto//TODO:should support Tkey type
    {
        /// <summary>
        /// ID数组
        /// </summary>
        public long?[] Id { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        [NotMapped]
        public virtual string[] OrderBy { get; set; } = null;
    }
    public class ReqFilterOrderDto: ReqFilterDto
    {
        /// <summary>
        /// 排序
        /// </summary>
        [NotMapped]
        public override string[] OrderBy { get; set; } = new string[] { nameof(Id) };
    }
    public class ReqFilterDto<TExt>: BObjExt<TExt> where TExt:BObjExt//TODO:should support Tkey type
    {
        /// <summary>
        /// ID数组
        /// </summary>
        public long?[] Id { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        [NotMapped]
        public virtual string[] OrderBy { get; set; } = null;
    }
    public class ReqFilterOrderbyIdDescDto<TExt> : ReqFilterDto<TExt> where TExt : BObjExt
    {
        /// <summary>
        /// 排序
        /// </summary>
        [NotMapped]
        public override string[] OrderBy { get; set; } = new string[] { $"-{nameof(Id)}" };
    }
}
